﻿// JavaScript Document

$.fn.extend({
		
	//aniFrame模組
	aniBGFrameExt:function(divID,aniH,aniFrame,aniTime){
		
		var aniMain 	= $(divID);
		var countId 	= 0;
		var aniFrameH   = aniH;
		
		setInterval( aniFrameStart, aniTime*1000 );
		
		function aniFrameStart(){
			
			//移動背景
			$(divID).css({ backgroundPosition:'0px ' + '-' + aniFrameH + 'px' });
			aniFrameH = aniH*countId;
			
			countId++;
			
			if( countId > aniFrame-1 ){				
				countId = 0;				
			};
			
			
		};
		
	}
	
});